<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/12/10
 * Time: 18:32
 */
namespace app\common\widget\appmsg;

use app\common\helper\appmsg_helper;

/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/12/8
 * Time: 18:00
 */
class appmsg_widget
{
    /**
     * 取得序列化的自动图文
     */
    public function get_serialize_automsg($params)
    {
        if (!$params || !isset($params['content'])) {
            return array();
        }

        $new_params = unserialize($params['content']);
        if (!$new_params) {
            return array();
        }
        if (isset($params['return_son_list']) && isset($new_params['query_num']) && $new_params['query_num'] > 1) {
            $new_params['return_son_list'] = 1;
        }
        $list = $this->get_automsg($new_params);
        if (empty($list)) {
            $list = array();
            $list[0] = appmsg_helper::get_empty_appmsg();
        }

        return $list;
    }

    /**
     * 取得自动图文信息
     */
    public function get_automsg($params)
    {

        return [];
    }
}